<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta content="width=device-width,initial-scale=1,maximum-scale=1" name="viewport">
    <meta content="telephone=no,email=no,address=no" name="format-detection">
    <meta content="on" http-equiv="x-dns-prefetch-control">
    <meta name="renderer" content="webkit" />
    <meta name="keyword" content="" />
    <meta name="description" content="" />
    <title>虚拟货币</title>
    <link rel="stylesheet" href="../../../static/css/reset.css">
    <link rel="stylesheet" href="../../../static/vendor/toastify/toastify.min.css">
    <link rel="stylesheet" href="../../../static/css/main.css">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="../../../static/vendor/html5shiv.min.js"></script>
    <script src="../../../static/vendor/respond.min.js"></script>
    <script>
        alert("您的浏览器版本过低请升级！");
        location.href = "http://outdatedbrowser.com/zh-cn";
    </script>
    <![endif]-->
</head>
<body class="model-body">
    <div id="app">
        <div class="model-page">
            <form id="edit-login-password">
                <div class="model-form">
                    <div class="model-form-item">
                        <div class="item-label">
                            旧登录密码：
                        </div>
                        <div class="item-control">
                            <input name="old_password" type="password" class="model-text" />
                        </div>
                    </div>
                    <div class="model-form-item">
                        <div class="item-label">
                            新登录密码：
                        </div>
                        <div class="item-control">
                            <input name="new_password" type="password" class="model-text" />
                        </div>
                    </div>
                    <div class="model-form-item">
                        <div class="item-label">
                            确认新登录密码：
                        </div>
                        <div class="item-control">
                            <input name="confirm_new_password" type="password" class="model-text" />
                        </div>
                    </div>
                    <div class="model-form-item">
                        <div class="item-label">
                            短信验证码：
                        </div>
                        <div class="item-control">
                            <input name="code" type="text" class="model-text model-text-special" />
                            <button class="get-code">获取验证码</button>
                        </div>
                    </div>
                    <div class="model-form-item">
                        <div class="item-control">
                            <input type="submit" value="确认" class="model-btn submit-btn">
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <script src="../../../static/vendor/jquery.min.js"></script>
    <script src="../../../static/vendor/layer/layer.js"></script>
    <script src="../../../static/vendor/jquery.validate/jquery.validate.min.js"></script>
    <script src="../../../static/vendor/jquery.validate/jquery.validate.extend.js"></script>
    <script src="../../../static/vendor/toastify/toastify-js.js"></script>
    <script src="../../../static/vendor/vue.min.js"></script>
    <script src="../../../static/vendor/vue-i18n.min.js"></script>
    <script src="../../../static/js/main.js"></script>
    <script>

        $(function(){

            $(".submit-btn").on("click",function(){
                $("#edit-login-password").validate({
                    rules: {
                        old_password: {
                            required: true
                        },
                        new_password: {
                            required: true,
                            noEqual:"[name='old_password']"
                        },
                        confirm_new_password: {
                            required: true,
                            equalTo: "[name='new_password']"
                        },
                        code: {
                            required: true,
                            codeVal:true
                        }
                    },
                    messages: {
                        old_password: {
                            required:"旧登录密码不能为空"
                        },
                        new_password: {
                            required:"新登录密码不能为空",
                            noEqual:"不能和旧登录密码相同"
                        },
                        confirm_new_password: {
                            required:"请确认您的新登录密码",
                            equalTo:"两次输入的新密码不一样"
                        },
                        code: "请输入有效的验证码"
                    },
                    submitHandler:function(form){
                        myToast("在这里提交~",'info');
                    }
                })
            });


            $(".get-code").on("click",function(){
                getCode(".get-code",120);
                return false;
            });

        })

    </script>
</body>
</html>